#include <bits/stdc++.h>

// smart pointers are not very useful here due to high overhead 
struct node {
    node *prev;
    node *ch[2];
    int key;
    void setCh(int x, node *n) {
        ch[x] = n;
        if (n != nil)
            n->prev = this;
    }
    bool red;
    static node *const nil;
    node() {}
private:
    node(nullptr_t) {
        key = -1;
        prev = ch[0] = ch[1] = nullptr;
        red = false;
    }
    static node _nil
};

node node::_nil(nullptr);
node *const node::nil = &_nil;

int isRightChild(node *r) {
    return r->prev->ch[1] == r;
}

void rotate(node *r, int child) {
    node *new_root = r->ch[child];
    if (r->prev != node::nil) {
        r->prev->ch[isRightChild(r)] = new_root;
    }
    new_root->prev = r->prev;
    r->prev = new_root;
    r->ch[child] = new_root->ch[child^1];
    new_root->ch[child^1] = r;
}

void rotate(node *nd) {
    node *pr = nd->prev;
    int x = isRightChild(nd);
    if (pr->prev != node::nil)
        pr->prev->setCh(isRightChild(pr), nd);
    nd->prev = pr->prev;
    pr->setCh(x, nd->ch[1 ^ x]);
    nd->setCh(1 ^ x, pr);
}

int _check_invariants(node *c) {
    if (c == node::nil)
        return 0;
    int a, b;
    if (((a = _check_invariants(c->ch[0])) == -1) || ((b = _check_invariants(c->ch[1])) == -1))
        return -1;
    if (a != b)
        return -1;
    if (c->red && (c->ch[0]->red || c->ch[1]->red))
        return -1;
    if (c->red)
        return a;
    else
        return a + 1;
}

void rb_insert_fix(node *&root, node *z);

void insert(node *&r, int key) {
    node *p = node::nil;
    node *c = r;
    while (c != node::nil) {
        if (c->key == key) {
            return; 
        } else {
            p = c;
            c = c->ch[c->key < key];
        }             
    }
    node *n = new node;
    n->ch[0] = n->ch[1] = node::nil;
    n->prev = p;
    n->key = key;
    n->red = true;
    if (p == node::nil)
        r = n;
    else
        p->ch[p->key < key] = n;
    rb_insert_fix(r, n);
}

/*
bool check_invariants(node *root) {
    return root->red == false && _check_invariants(root) != -1;
}
/*/
bool check_invariants(node *) {
    return true;
}
//*/

void rb_insert_fix(node *&root, node *z) {
    while (z->prev->red) {
        bool dir = isRightChild(z->prev);
        node *y = z->prev->prev->ch[dir^1];;
        if (y->red) {
            z->prev->red = false;
            y->red = false;
            z->prev->prev->red = true;
            z = z->prev->prev;
        } else {
            if (isRightChild(z) != dir) {
                node *nz = z->prev;
                rotate(z);
                z = nz;
            }
            z->prev->red = false;
            z->prev->prev->red = true;
            if (z->prev->prev == root)
                root = z->prev;
            rotate(z->prev);
        }
    }
    root->red = false;
    assert(check_invariants(root));
}

bool check(node *n, int key) {
    if (n == node::nil)
        return false;
    if (n->key == key)
        return true;
    return check(n->ch[n->key < key], key);
}

void print_tree(node *x) {
    if (x == node::nil)
        return;
    print_tree(x->ch[0]);
    printf("%d ", x->key);
    print_tree(x->ch[1]);
}

void del(node *nd) {
    if (nd == node::nil)
        return;
    del(nd->ch[0]);
    del(nd->ch[1]);
    delete nd;
}

class tree {
    node *root_ = node::nil;
public:
    void insert(int key) {
        ::insert(root_, key);
    }
    bool check(int key) const {
        return ::check(root_, key);
    }
    ~tree() {
        del(root_);
    }
};

int main() {
    tree t;
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        int u, v;
        scanf("%d%d", &u, &v);
        if (u) {
            puts(t.check(v)? "Yes" : "No");
        } else {
            t.insert(v);
        }
    }
}

